Optimal. Leaf size=136 \[ -\frac {\sqrt [4]{b} \tan ^{-1}\left (\frac {\sqrt [4]{b} \cos (c+d x)}{\sqrt {\sqrt {a}-\sqrt {b}}}\right )}{2 a \sqrt {\sqrt {a}-\sqrt {b}} d}-\frac {\tanh ^{-1}(\cos (c+d x))}{a d}+\frac {\sqrt [4]{b} \tanh ^{-1}\left (\frac {\sqrt [4]{b} \cos (c+d x)}{\sqrt {\sqrt {a}+\sqrt {b}}}\right )}{2 a \sqrt {\sqrt {a}+\sqrt {b}} d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.13, antiderivative size = 136, normalized size of antiderivative = 1.00, number of steps
used = 7, number of rules used = 6, integrand size = 22, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.273, Rules used = {3294, 1184,
213, 1180, 211, 214} \begin {gather*} -\frac {\sqrt [4]{b} \text {ArcTan}\left (\frac {\sqrt [4]{b} \cos (c+d x)}{\sqrt {\sqrt {a}-\sqrt {b}}}\right )}{2 a d \sqrt {\sqrt {a}-\sqrt {b}}}+\frac {\sqrt [4]{b} \tanh ^{-1}\left (\frac {\sqrt [4]{b} \cos (c+d x)}{\sqrt {\sqrt {a}+\sqrt {b}}}\right )}{2 a d \sqrt {\sqrt {a}+\sqrt {b}}}-\frac {\tanh ^{-1}(\cos (c+d x))}{a d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 211
Rule 213
Rule 214
Rule 1180
Rule 1184
Rule 3294
Rubi steps
\begin {align*} \int \frac {\csc (c+d x)}{a-b \sin ^4(c+d x)} \, dx &=-\frac {\text {Subst}\left (\int \frac {1}{\left (1-x^2\right ) \left (a-b+2 b x^2-b x^4\right )} \, dx,x,\cos (c+d x)\right )}{d}\\ &=-\frac {\text {Subst}\left (\int \left (-\frac {1}{a \left (-1+x^2\right )}+\frac {b-b x^2}{a \left (a-b+2 b x^2-b x^4\right )}\right ) \, dx,x,\cos (c+d x)\right )}{d}\\ &=\frac {\text {Subst}\left (\int \frac {1}{-1+x^2} \, dx,x,\cos (c+d x)\right )}{a d}-\frac {\text {Subst}\left (\int \frac {b-b x^2}{a-b+2 b x^2-b x^4} \, dx,x,\cos (c+d x)\right )}{a d}\\ &=-\frac {\tanh ^{-1}(\cos (c+d x))}{a d}+\frac {b \text {Subst}\left (\int \frac {1}{-\sqrt {a} \sqrt {b}+b-b x^2} \, dx,x,\cos (c+d x)\right )}{2 a d}+\frac {b \text {Subst}\left (\int \frac {1}{\sqrt {a} \sqrt {b}+b-b x^2} \, dx,x,\cos (c+d x)\right )}{2 a d}\\ &=-\frac {\sqrt [4]{b} \tan ^{-1}\left (\frac {\sqrt [4]{b} \cos (c+d x)}{\sqrt {\sqrt {a}-\sqrt {b}}}\right )}{2 a \sqrt {\sqrt {a}-\sqrt {b}} d}-\frac {\tanh ^{-1}(\cos (c+d x))}{a d}+\frac {\sqrt [4]{b} \tanh ^{-1}\left (\frac {\sqrt [4]{b} \cos (c+d x)}{\sqrt {\sqrt {a}+\sqrt {b}}}\right )}{2 a \sqrt {\sqrt {a}+\sqrt {b}} d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] Result contains higher order function than in optimal. Order 9 vs. order 3 in
optimal.
time = 0.19, size = 318, normalized size = 2.34 \begin {gather*} -\frac {8 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )-8 \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )+i b \text {RootSum}\left [b-4 b \text {$\#$1}^2-16 a \text {$\#$1}^4+6 b \text {$\#$1}^4-4 b \text {$\#$1}^6+b \text {$\#$1}^8\&,\frac {-2 \tan ^{-1}\left (\frac {\sin (c+d x)}{\cos (c+d x)-\text {$\#$1}}\right )+i \log \left (1-2 \cos (c+d x) \text {$\#$1}+\text {$\#$1}^2\right )+6 \tan ^{-1}\left (\frac {\sin (c+d x)}{\cos (c+d x)-\text {$\#$1}}\right ) \text {$\#$1}^2-3 i \log \left (1-2 \cos (c+d x) \text {$\#$1}+\text {$\#$1}^2\right ) \text {$\#$1}^2-6 \tan ^{-1}\left (\frac {\sin (c+d x)}{\cos (c+d x)-\text {$\#$1}}\right ) \text {$\#$1}^4+3 i \log \left (1-2 \cos (c+d x) \text {$\#$1}+\text {$\#$1}^2\right ) \text {$\#$1}^4+2 \tan ^{-1}\left (\frac {\sin (c+d x)}{\cos (c+d x)-\text {$\#$1}}\right ) \text {$\#$1}^6-i \log \left (1-2 \cos (c+d x) \text {$\#$1}+\text {$\#$1}^2\right ) \text {$\#$1}^6}{-b \text {$\#$1}-8 a \text {$\#$1}^3+3 b \text {$\#$1}^3-3 b \text {$\#$1}^5+b \text {$\#$1}^7}\&\right ]}{8 a d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.52, size = 119, normalized size = 0.88
method | result | size |
derivativedivides | \(\frac {-\frac {b^{2} \left (-\frac {\arctanh \left (\frac {b \cos \left (d x +c \right )}{\sqrt {\left (\sqrt {a b}+b \right ) b}}\right )}{2 b \sqrt {\left (\sqrt {a b}+b \right ) b}}+\frac {\arctan \left (\frac {b \cos \left (d x +c \right )}{\sqrt {\left (\sqrt {a b}-b \right ) b}}\right )}{2 b \sqrt {\left (\sqrt {a b}-b \right ) b}}\right )}{a}+\frac {\ln \left (\cos \left (d x +c \right )-1\right )}{2 a}-\frac {\ln \left (1+\cos \left (d x +c \right )\right )}{2 a}}{d}\) | \(119\) |
default | \(\frac {-\frac {b^{2} \left (-\frac {\arctanh \left (\frac {b \cos \left (d x +c \right )}{\sqrt {\left (\sqrt {a b}+b \right ) b}}\right )}{2 b \sqrt {\left (\sqrt {a b}+b \right ) b}}+\frac {\arctan \left (\frac {b \cos \left (d x +c \right )}{\sqrt {\left (\sqrt {a b}-b \right ) b}}\right )}{2 b \sqrt {\left (\sqrt {a b}-b \right ) b}}\right )}{a}+\frac {\ln \left (\cos \left (d x +c \right )-1\right )}{2 a}-\frac {\ln \left (1+\cos \left (d x +c \right )\right )}{2 a}}{d}\) | \(119\) |
risch | \(\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}{a d}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}{a d}+2 i \left (\munderset {\textit {\_R} =\RootOf \left (\left (4096 a^{5} d^{4}-4096 a^{4} b \,d^{4}\right ) \textit {\_Z}^{4}-128 a^{2} b \,d^{2} \textit {\_Z}^{2}-b \right )}{\sum }\textit {\_R} \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+\left (\left (-\frac {1024 i d^{3} a^{4}}{b}+1024 i a^{3} d^{3}\right ) \textit {\_R}^{3}+32 i a d \textit {\_R} \right ) {\mathrm e}^{i \left (d x +c \right )}+1\right )\right )\) | \(143\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 773 vs.
\(2 (100) = 200\).
time = 0.51, size = 773, normalized size = 5.68 \begin {gather*} \frac {a d \sqrt {-\frac {{\left (a^{3} - a^{2} b\right )} d^{2} \sqrt {\frac {b}{{\left (a^{5} - 2 \, a^{4} b + a^{3} b^{2}\right )} d^{4}}} + b}{{\left (a^{3} - a^{2} b\right )} d^{2}}} \log \left (b \cos \left (d x + c\right ) - {\left ({\left (a^{4} - a^{3} b\right )} d^{3} \sqrt {\frac {b}{{\left (a^{5} - 2 \, a^{4} b + a^{3} b^{2}\right )} d^{4}}} - a b d\right )} \sqrt {-\frac {{\left (a^{3} - a^{2} b\right )} d^{2} \sqrt {\frac {b}{{\left (a^{5} - 2 \, a^{4} b + a^{3} b^{2}\right )} d^{4}}} + b}{{\left (a^{3} - a^{2} b\right )} d^{2}}}\right ) - a d \sqrt {\frac {{\left (a^{3} - a^{2} b\right )} d^{2} \sqrt {\frac {b}{{\left (a^{5} - 2 \, a^{4} b + a^{3} b^{2}\right )} d^{4}}} - b}{{\left (a^{3} - a^{2} b\right )} d^{2}}} \log \left (b \cos \left (d x + c\right ) - {\left ({\left (a^{4} - a^{3} b\right )} d^{3} \sqrt {\frac {b}{{\left (a^{5} - 2 \, a^{4} b + a^{3} b^{2}\right )} d^{4}}} + a b d\right )} \sqrt {\frac {{\left (a^{3} - a^{2} b\right )} d^{2} \sqrt {\frac {b}{{\left (a^{5} - 2 \, a^{4} b + a^{3} b^{2}\right )} d^{4}}} - b}{{\left (a^{3} - a^{2} b\right )} d^{2}}}\right ) - a d \sqrt {-\frac {{\left (a^{3} - a^{2} b\right )} d^{2} \sqrt {\frac {b}{{\left (a^{5} - 2 \, a^{4} b + a^{3} b^{2}\right )} d^{4}}} + b}{{\left (a^{3} - a^{2} b\right )} d^{2}}} \log \left (-b \cos \left (d x + c\right ) - {\left ({\left (a^{4} - a^{3} b\right )} d^{3} \sqrt {\frac {b}{{\left (a^{5} - 2 \, a^{4} b + a^{3} b^{2}\right )} d^{4}}} - a b d\right )} \sqrt {-\frac {{\left (a^{3} - a^{2} b\right )} d^{2} \sqrt {\frac {b}{{\left (a^{5} - 2 \, a^{4} b + a^{3} b^{2}\right )} d^{4}}} + b}{{\left (a^{3} - a^{2} b\right )} d^{2}}}\right ) + a d \sqrt {\frac {{\left (a^{3} - a^{2} b\right )} d^{2} \sqrt {\frac {b}{{\left (a^{5} - 2 \, a^{4} b + a^{3} b^{2}\right )} d^{4}}} - b}{{\left (a^{3} - a^{2} b\right )} d^{2}}} \log \left (-b \cos \left (d x + c\right ) - {\left ({\left (a^{4} - a^{3} b\right )} d^{3} \sqrt {\frac {b}{{\left (a^{5} - 2 \, a^{4} b + a^{3} b^{2}\right )} d^{4}}} + a b d\right )} \sqrt {\frac {{\left (a^{3} - a^{2} b\right )} d^{2} \sqrt {\frac {b}{{\left (a^{5} - 2 \, a^{4} b + a^{3} b^{2}\right )} d^{4}}} - b}{{\left (a^{3} - a^{2} b\right )} d^{2}}}\right ) - 2 \, \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) + 2 \, \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right )}{4 \, a d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\csc {\left (c + d x \right )}}{a - b \sin ^{4}{\left (c + d x \right )}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: NotImplementedError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 15.36, size = 2031, normalized size = 14.93 \begin {gather*} -\frac {\mathrm {atan}\left (\frac {\left (\left (\left (\sqrt {\frac {a^2\,b+\sqrt {a^5\,b}}{16\,\left (a^4\,b-a^5\right )}}\,\left (256\,a^4\,b^4-192\,a^3\,b^5+\cos \left (c+d\,x\right )\,\left (768\,a^4\,b^5-512\,a^5\,b^4\right )\,\sqrt {\frac {a^2\,b+\sqrt {a^5\,b}}{16\,\left (a^4\,b-a^5\right )}}\right )-144\,a^2\,b^5\,\cos \left (c+d\,x\right )\right )\,\sqrt {\frac {a^2\,b+\sqrt {a^5\,b}}{16\,\left (a^4\,b-a^5\right )}}+12\,a\,b^5\right )\,\sqrt {\frac {a^2\,b+\sqrt {a^5\,b}}{16\,\left (a^4\,b-a^5\right )}}+6\,b^5\,\cos \left (c+d\,x\right )\right )\,\sqrt {\frac {a^2\,b+\sqrt {a^5\,b}}{16\,\left (a^4\,b-a^5\right )}}\,1{}\mathrm {i}+\left (\left (\left (\sqrt {\frac {a^2\,b+\sqrt {a^5\,b}}{16\,\left (a^4\,b-a^5\right )}}\,\left (192\,a^3\,b^5-256\,a^4\,b^4+\cos \left (c+d\,x\right )\,\left (768\,a^4\,b^5-512\,a^5\,b^4\right )\,\sqrt {\frac {a^2\,b+\sqrt {a^5\,b}}{16\,\left (a^4\,b-a^5\right )}}\right )-144\,a^2\,b^5\,\cos \left (c+d\,x\right )\right )\,\sqrt {\frac {a^2\,b+\sqrt {a^5\,b}}{16\,\left (a^4\,b-a^5\right )}}-12\,a\,b^5\right )\,\sqrt {\frac {a^2\,b+\sqrt {a^5\,b}}{16\,\left (a^4\,b-a^5\right )}}+6\,b^5\,\cos \left (c+d\,x\right )\right )\,\sqrt {\frac {a^2\,b+\sqrt {a^5\,b}}{16\,\left (a^4\,b-a^5\right )}}\,1{}\mathrm {i}}{\left (\left (\left (\sqrt {\frac {a^2\,b+\sqrt {a^5\,b}}{16\,\left (a^4\,b-a^5\right )}}\,\left (256\,a^4\,b^4-192\,a^3\,b^5+\cos \left (c+d\,x\right )\,\left (768\,a^4\,b^5-512\,a^5\,b^4\right )\,\sqrt {\frac {a^2\,b+\sqrt {a^5\,b}}{16\,\left (a^4\,b-a^5\right )}}\right )-144\,a^2\,b^5\,\cos \left (c+d\,x\right )\right )\,\sqrt {\frac {a^2\,b+\sqrt {a^5\,b}}{16\,\left (a^4\,b-a^5\right )}}+12\,a\,b^5\right )\,\sqrt {\frac {a^2\,b+\sqrt {a^5\,b}}{16\,\left (a^4\,b-a^5\right )}}+6\,b^5\,\cos \left (c+d\,x\right )\right )\,\sqrt {\frac {a^2\,b+\sqrt {a^5\,b}}{16\,\left (a^4\,b-a^5\right )}}-\left (\left (\left (\sqrt {\frac {a^2\,b+\sqrt {a^5\,b}}{16\,\left (a^4\,b-a^5\right )}}\,\left (192\,a^3\,b^5-256\,a^4\,b^4+\cos \left (c+d\,x\right )\,\left (768\,a^4\,b^5-512\,a^5\,b^4\right )\,\sqrt {\frac {a^2\,b+\sqrt {a^5\,b}}{16\,\left (a^4\,b-a^5\right )}}\right )-144\,a^2\,b^5\,\cos \left (c+d\,x\right )\right )\,\sqrt {\frac {a^2\,b+\sqrt {a^5\,b}}{16\,\left (a^4\,b-a^5\right )}}-12\,a\,b^5\right )\,\sqrt {\frac {a^2\,b+\sqrt {a^5\,b}}{16\,\left (a^4\,b-a^5\right )}}+6\,b^5\,\cos \left (c+d\,x\right )\right )\,\sqrt {\frac {a^2\,b+\sqrt {a^5\,b}}{16\,\left (a^4\,b-a^5\right )}}}\right )\,\sqrt {\frac {a^2\,b+\sqrt {a^5\,b}}{16\,\left (a^4\,b-a^5\right )}}\,2{}\mathrm {i}}{d}-\frac {\mathrm {atanh}\left (\frac {32\,b^4\,\cos \left (c+d\,x\right )}{32\,b^4-\frac {18\,b^5}{a}}-\frac {18\,b^5\,\cos \left (c+d\,x\right )}{32\,a\,b^4-18\,b^5}\right )}{a\,d}-\frac {\mathrm {atan}\left (\frac {\left (6\,b^5\,\cos \left (c+d\,x\right )+\left (\left (\left (256\,a^4\,b^4-192\,a^3\,b^5+\cos \left (c+d\,x\right )\,\left (768\,a^4\,b^5-512\,a^5\,b^4\right )\,\sqrt {\frac {a^2\,b-\sqrt {a^5\,b}}{16\,\left (a^4\,b-a^5\right )}}\right )\,\sqrt {\frac {a^2\,b-\sqrt {a^5\,b}}{16\,\left (a^4\,b-a^5\right )}}-144\,a^2\,b^5\,\cos \left (c+d\,x\right )\right )\,\sqrt {\frac {a^2\,b-\sqrt {a^5\,b}}{16\,\left (a^4\,b-a^5\right )}}+12\,a\,b^5\right )\,\sqrt {\frac {a^2\,b-\sqrt {a^5\,b}}{16\,\left (a^4\,b-a^5\right )}}\right )\,\sqrt {\frac {a^2\,b-\sqrt {a^5\,b}}{16\,\left (a^4\,b-a^5\right )}}\,1{}\mathrm {i}+\left (6\,b^5\,\cos \left (c+d\,x\right )+\left (\left (\left (192\,a^3\,b^5-256\,a^4\,b^4+\cos \left (c+d\,x\right )\,\left (768\,a^4\,b^5-512\,a^5\,b^4\right )\,\sqrt {\frac {a^2\,b-\sqrt {a^5\,b}}{16\,\left (a^4\,b-a^5\right )}}\right )\,\sqrt {\frac {a^2\,b-\sqrt {a^5\,b}}{16\,\left (a^4\,b-a^5\right )}}-144\,a^2\,b^5\,\cos \left (c+d\,x\right )\right )\,\sqrt {\frac {a^2\,b-\sqrt {a^5\,b}}{16\,\left (a^4\,b-a^5\right )}}-12\,a\,b^5\right )\,\sqrt {\frac {a^2\,b-\sqrt {a^5\,b}}{16\,\left (a^4\,b-a^5\right )}}\right )\,\sqrt {\frac {a^2\,b-\sqrt {a^5\,b}}{16\,\left (a^4\,b-a^5\right )}}\,1{}\mathrm {i}}{\left (6\,b^5\,\cos \left (c+d\,x\right )+\left (\left (\left (256\,a^4\,b^4-192\,a^3\,b^5+\cos \left (c+d\,x\right )\,\left (768\,a^4\,b^5-512\,a^5\,b^4\right )\,\sqrt {\frac {a^2\,b-\sqrt {a^5\,b}}{16\,\left (a^4\,b-a^5\right )}}\right )\,\sqrt {\frac {a^2\,b-\sqrt {a^5\,b}}{16\,\left (a^4\,b-a^5\right )}}-144\,a^2\,b^5\,\cos \left (c+d\,x\right )\right )\,\sqrt {\frac {a^2\,b-\sqrt {a^5\,b}}{16\,\left (a^4\,b-a^5\right )}}+12\,a\,b^5\right )\,\sqrt {\frac {a^2\,b-\sqrt {a^5\,b}}{16\,\left (a^4\,b-a^5\right )}}\right )\,\sqrt {\frac {a^2\,b-\sqrt {a^5\,b}}{16\,\left (a^4\,b-a^5\right )}}-\left (6\,b^5\,\cos \left (c+d\,x\right )+\left (\left (\left (192\,a^3\,b^5-256\,a^4\,b^4+\cos \left (c+d\,x\right )\,\left (768\,a^4\,b^5-512\,a^5\,b^4\right )\,\sqrt {\frac {a^2\,b-\sqrt {a^5\,b}}{16\,\left (a^4\,b-a^5\right )}}\right )\,\sqrt {\frac {a^2\,b-\sqrt {a^5\,b}}{16\,\left (a^4\,b-a^5\right )}}-144\,a^2\,b^5\,\cos \left (c+d\,x\right )\right )\,\sqrt {\frac {a^2\,b-\sqrt {a^5\,b}}{16\,\left (a^4\,b-a^5\right )}}-12\,a\,b^5\right )\,\sqrt {\frac {a^2\,b-\sqrt {a^5\,b}}{16\,\left (a^4\,b-a^5\right )}}\right )\,\sqrt {\frac {a^2\,b-\sqrt {a^5\,b}}{16\,\left (a^4\,b-a^5\right )}}}\right )\,\sqrt {\frac {a^2\,b-\sqrt {a^5\,b}}{16\,\left (a^4\,b-a^5\right )}}\,2{}\mathrm {i}}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________